export function formatDateToCustom(date: Date) {
  const pad = (num: number) => String(num).padStart(2, "0");

  const localDate = new Date(date.getTime() + date.getTimezoneOffset() * 60000);

  const day = pad(localDate.getDate());
  const month = pad(localDate.getMonth() + 1); // Месяцы начинаются с 0
  const year = localDate.getFullYear();
  const hours = pad(localDate.getHours());
  const minutes = pad(localDate.getMinutes());

  return `${day}.${month}.${year} ${hours}:${minutes}`;
}
